<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品管理页面</title>
    <script src="../js/vue.js"></script>
    <script src="../js/httpVueLoader.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <!-- 引入组件库 -->
    <script src="../plugins/elementui/index.js"></script>
    <link rel="stylesheet" href="../font-awesome-4.7.0/css/font-awesome.min.css">
    <script src="../js/axios-0.18.0.js"></script>
    <script src="../js/vue-router.js"></script>
</head>

<body>
<div id="app">
</div>
<script>
    // 在 vue 中启用路由
    Vue.use(VueRouter);

    var spgl = httpVueLoader("../vues/spgl.vue");
    // 将外部加载的 vue 注册为 vue 的组件。
    var left_menu = httpVueLoader("../vues/left-menu-plus.vue");
    var header = httpVueLoader("../vues/header.vue");
    var spglheader = httpVueLoader("../vues/goods-manage-header.vue");
    Vue.component("leftmenu", left_menu);
    Vue.component("headerinfo", header);
    Vue.component("spglheader", spglheader);

    var index = httpVueLoader("../vues/index.vue");
    Vue.component("index", index);

    const router = new VueRouter({
        routes: [
            {path: '/spgl', component: spgl},
            {path: '/index', component: index},
        ]
    })


    new Vue({
        router: router,
        render: (h) => h(spgl)
    }).$mount("#app");
</script>
</body>

</html>